package com.jeesite.modules.rt.service;

import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeesite.common.entity.Page;
import com.jeesite.common.service.CrudService;
import com.jeesite.modules.rt.entity.RtDeviceHardware;
import com.jeesite.modules.rt.dao.RtDeviceHardwareDao;

/**
 * 硬件信息Service
 * @author 李寒冰
 * @version 2024-09-26
 */
@Service
public class RtDeviceHardwareService extends CrudService<RtDeviceHardwareDao, RtDeviceHardware> {
	
	/**
	 * 获取单条数据
	 * @param rtDeviceHardware
	 * @return
	 */
	@Override
	public RtDeviceHardware get(RtDeviceHardware rtDeviceHardware) {
		return super.get(rtDeviceHardware);
	}


	public RtDeviceHardware findOneBySn(String sn) {
		RtDeviceHardware rtDeviceHardware = new RtDeviceHardware();
		rtDeviceHardware.setSn(sn);
		List<RtDeviceHardware> list = dao.findList(rtDeviceHardware);
		if (list != null && list.size() > 0) {
			return list.get(0);
		}
		return null;
	}

	/**
	 * 查询分页数据
	 * @param rtDeviceHardware 查询条件
	 * @param rtDeviceHardware page 分页对象
	 * @return
	 */
	@Override
	public Page<RtDeviceHardware> findPage(RtDeviceHardware rtDeviceHardware) {
		return super.findPage(rtDeviceHardware);
	}
	
	/**
	 * 查询列表数据
	 * @param rtDeviceHardware
	 * @return
	 */
	@Override
	public List<RtDeviceHardware> findList(RtDeviceHardware rtDeviceHardware) {
		return super.findList(rtDeviceHardware);
	}
	
	/**
	 * 保存数据（插入或更新）
	 * @param rtDeviceHardware
	 */
	@Override
	@Transactional
	public void save(RtDeviceHardware rtDeviceHardware) {
		super.save(rtDeviceHardware);
	}
	
	/**
	 * 更新状态
	 * @param rtDeviceHardware
	 */
	@Override
	@Transactional
	public void updateStatus(RtDeviceHardware rtDeviceHardware) {
		super.updateStatus(rtDeviceHardware);
	}
	
	/**
	 * 删除数据
	 * @param rtDeviceHardware
	 */
	@Override
	@Transactional
	public void delete(RtDeviceHardware rtDeviceHardware) {
		super.delete(rtDeviceHardware);
	}
	
}